/**
 * EnableStatus枚举
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.enums;


import java.util.Arrays;

public enum EnableStatus {
    ENABLED(1, "启用"),
    DISABLED(0, "禁用");

    private final int value;
    private final String description;

    EnableStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public int getValue() {
        return value;
    }

    public String getDescription() {
        return description;
    }

    public static EnableStatus fromValue(int value) {
        return Arrays.stream(EnableStatus.values())
            .filter(status -> status.getValue() == value)
            .findFirst()
            .orElse(null);
    }
} 